package pl.perseus.action;

import lombok.Getter;
import lombok.Setter;

import org.springframework.beans.factory.annotation.Autowired;

import pl.perseus.model.UserClasses;
import pl.perseus.service.userclasses.IUserClassesService;

public class AssignTeacherToClassesAction extends BaseAction {

	@Getter
	@Setter
	UserClasses teacherClasses;
	
	@Autowired
	IUserClassesService userClassesService;
	
	@Override
	public String execute() {
		teacherClasses.setActive(true);
		userClassesService.insertUserClasses(teacherClasses);
		
		logAction("Assigning teacher: " + teacherClasses.getId_user() + " " + "to classes: " + teacherClasses.getId_classes());
		
		return SUCCESS;
	}

}
